<?php
class App_Tpl_Paginator extends Mozg_Templator
{
    /**
		переменная страницы для подстановки
     */
    protected $pageVar = '__page__';

    public function Get(Mozg_Paginator $paginator, $pattern)
    {
    	$this->totalPages = $paginator->GetTotalPages();
    	if ($this->totalPages < 2) return '';
    	
    	$this->page = $paginator->GetPage();
    	if ($this->page > $this->totalPages) $this->page = $this->totalPages + 1;
    	$this->pattern = $pattern;

    	return $this->render('paginator/_paginator.phtml');
    }
}